package com.ymatou.iapi.sellercs.service;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ymatou.iapi.sellercs.parameter.SendMessageResp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*SendMessage
*FreeMaker Template自动生成代码
*/
public class SendMessageCall extends YmatouBaseCall{
	private static String opurl ="Api/Message/SendMessage";
	
	public SendMessageCall() {
		super(EnvSetup.getSystemUrl("sellercs_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public SendMessageResp getResult(){
		String sendMessageResModel=getJsonObject().get("Result").toString();
		Gson gson = new GsonBuilder().disableHtmlEscaping().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
		SendMessageResp result=gson.fromJson(sendMessageResModel, SendMessageResp.class);
		return result;
	}
}